<link rel="stylesheet" href="<?php echo base_url();?>assets/css/confirm/alertify.core.css" />
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/confirm/alertify.default.css" id="toggleCSS" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
	<script src="<?php echo base_url();?>assets/js/lib/alertify.min.js"></script>
	<script>
		var myVar;
		function reset () {
			$("#toggleCSS").attr("href", "<?php echo base_url();?>assets/css/confirm/alertify.default.css");
			alertify.set({
				labels : {
					ok     : "OK",
					cancel : "Cancel"
				},
				delay : 5000,
				buttonReverse : false,
				buttonFocus   : "ok"
			});
		}

		function deleteUser(id){
			myVar = id;
		}

		$(".confirm").on( 'click', function () {
			reset();
			alertify.confirm("Do you want to delete this user?", function (e) {
				if (e) {
					<?php if ($info == 'user'){ ?>
						window.location.href = "<?php echo site_url('user/delete')?>?id="+myVar;
					<?php }elseif ($info == 'home'){?>
						window.location.href = "<?php echo site_url('home/delete')?>?id="+myVar;
					<?php }elseif ($info == 'table'){?>
						window.location.href = "<?php echo site_url('table/delete')?>?id="+myVar;
					<?php }?>
				}
			});
			return false;
		});
	</script>